<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>骨医快线</title>
	<link rel="stylesheet" href="../../css/mui.plus.css" />
	<style type="text/css">
		footer {
			padding: 20px 30%;
		}
		.mui-btn-block {
			padding: 12px 0;
			border-radius: 8px;
		}
	</style>
</head>
<body style="background-color: #fff;">
	<header class="mui-bar mui-bar-nav pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">意见反馈</h1>
	</header>
	
	<div class="mui-content" style="background-color: #fff;">
		<div style="width: 90%;margin: 0 auto;"> 
			<div style="margin: 20px 0 6px 0;">您的意见</div>
			<textarea id="txt-fb" name="" rows="8" cols="" placeholder="请输入您对骨医快线的意见及建议" style="background-color: #eee;"></textarea>
			<div style="margin: 20px 0 6px 0;">请留下您的手机号码,方便我们与您联系</div>
			<input id="txt-tel" type="tel" maxlength="11" style="border: none;background-color: #eee;"  placeholder="手机号码"/>
		</div>
	</div>
	
	<footer>
		<button id="btn-submit" type="button" class="mui-btn mui-btn-primary mui-btn-block">确认提交</button>
	</footer>
	
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script>
		(function($, a){
			var txtFb = document.getElementById("txt-fb"),
				txtTel = document.getElementById("txt-tel"),
				btnSub = document.getElementById("btn-submit");
				
			$('footer').on('tap', '#btn-submit', function(){
				
				if(!txtFb.value) return $.toast('请输入您的反馈意见哦~');
				if(!txtTel.value || !(/^1[3|4|5|7|8]\d{9}$/.test(txtTel.value))) return $.toast('请输入有效的手机号~');
				
				a.net.post('feedbacks/create.json', {fb_dr_mobile: txtTel.value, fb_content: txtFb.value}, function(data){
					if(data && data.code === '100'){
						$.alert('您的意见已提交\n我们将及时给您反馈\n感谢您的支持', '', '返回个人中心', function(){
							$.back()
						})
					}
				})
			});
		}(mui, app));
	</script>
</body>
</html>